<template>
  <div class="cate-item" @click="$router.push('/recommendDetail/' + item.id)">
    <img :src="item.pic" alt="" />
    <p>{{ item.name }}</p>
  </div>
</template>

<script>
import { ref, reactive, toRefs } from "vue";
import { useStore } from "vuex";
import { useRouter, useRoute } from "vue-router";
export default {
  props: {
    item: Object,
  },
  setup(props, ctx) {
    const store = useStore();
    const router = useRouter();
    const route = useRoute();
    const data = reactive({});
    return { ...toRefs(data) };
  },
};
</script>

<style lang="scss">
.cate-item {
  width: 48%;
  position: relative;
  margin-top: 10px;
  img {
    width: 100%;
  }
  p {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 28px;
    background: #f0edd4;
    font-size: 10px;
    color: #b69b72;
    // text-indent: 2em;
    line-height: 28px;
  }
}
</style>
